package com.portal.file.controller;

import com.portal.common.core.web.controller.BaseController;
import com.portal.common.core.web.page.TableDataInfo;
import com.portal.file.domain.FileVo;
import com.portal.file.service.MinioService;
import com.portal.system.api.domain.SysFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * 文件请求处理
 *
 * @author portal
 */
@RestController
@RequestMapping("portalFile")
public class SysFileController extends BaseController {
    private static final Logger log = LoggerFactory.getLogger(SysFileController.class);

    @Resource
    private MinioService sysFileService;

    @GetMapping("/listFiles")
    public TableDataInfo listFiles(FileVo fileVo) {
        SysFile sysFile = SysFile.builder()
                .fileSize(109L)
                .archiveType("归档")
                .fileUrl("url")
                .fileType("文件类型")
                .uploadTime(new Date())
                .fileOriginalName("文件名称")
                .id(1L)
                .userName("上传人")
                .build();
        List<SysFile> sysFiles = Arrays.asList(sysFile);
        return getDataTable(sysFiles);
    }
}